<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/WEB-INF/tld/components.tld" prefix="up"%>
<%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="pp" uri="http://java.sun.com/jsp/jstl/fmt"%>
<jsp:useBean id="agora" class="java.util.Date" />
<%@taglib tagdir="/WEB-INF/tags" prefix="p"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.ArrayList"%>
<%@page import="edu.up.beans.ClienteBean"%>
<%@page import="edu.up.controle.Cliente"%>
<html>
<jsp:include page="/Autorizacao.jsp" flush="false" />
<jsp:include page="header.jsp">
	<jsp:param name="function" value="Lista de Clientes Cadastrados" />
</jsp:include>
<jsp:useBean id="listaCliBean" scope="session"
	class="edu.up.beans.ClienteBean" />
<body>
<!-- begin #container -->
<div id="container"><!-- begin #header -->
<div id="header">
<div class="headerBackground"></div>
<div id="navcontainer">
<ul id="navlist">
	<li><a href="index.jsp"><up:label property="menu.home" /></a></li>
	<li><a href="Sonhos.jsp"><up:label property="menu.sonhos" /></a></li>
	<li><a
		href="<%=request.getContextPath()%>/RelatoriosServlet?acao=RelDepoimentos"><up:label
		property="menu.depoimentos" /></a></li>
	<li><a href="Login.jsp"><up:label property="menu.login" /></a></li>
	<li><a href="Sobre.jsp"><up:label property="menu.sobre" /></a></li>
	<li><up:countryOption country="Brasil" locale="pt_BR" /></li>
	<li><up:countryOption country="USA" locale="en_US" /></li>
	<li><up:countryOption country="Espanha" locale="es_ES" /></li>
	<li><a
		href="<%=request.getContextPath()%>/ControleServlet?funcao=Start"><img
		src="images/logout.png" alt="Logout" /></a></li>
</ul>
</div>
</div>
<!-- end #header --> <!-- begin #mainContent -->
<div id="mainContent">
<div class="t">
<div class="b">
<div class="l">
<div class="r">
<div class="bl">
<div class="br">
<div class="tl">
<div class="tr"><up:label property="texto.l49" />
<form id="frmLista" name="frmLista" method="post"><script>


            function validar(paramAcao)
			{
		
			document.frmLista.action="<%=request.getContextPath()%>/ClienteServlet?acao=Excluir";
			document.frmLista.submit();
		
			}
            
            function get_radio_value()
            {
            for (var i=0; i < document.frmLista.rdId.length; i++)
               {
               if (document.frmLista.rdId[i].checked)
                  {
                  var rad_val = document.frmLista.rdId[i].value;
                  alert(rad_val);
                  
                  }
               }
            }
            
           
            </script> <br />
<p>
<table border="1">
	<tr>
		<up:label property="texto.l50" />
		<up:label property="texto.l51" />
		<up:label property="texto.l52" />
		<up:label property="texto.l53" />
		<up:label property="texto.l54" />
		<up:label property="texto.l55" />
		<up:label property="texto.l56" />
		<up:label property="texto.l57" />
		<up:label property="texto.l58" />
		<up:label property="texto.l59" />
		<up:label property="texto.l60" />
		<up:label property="texto.l61" />



	</tr>

	<%  
            		ArrayList<ClienteBean> list = (ArrayList<ClienteBean>) request.getAttribute("listaCliBean");
            		
            		
            		for (int i = 0; i < list.size(); i++) { %>
	<TR>
		<TD><input type="radio" name="rdId" id="rdId"
			value="<%=list.get(i).getId() %>" /><%=list.get(i).getId() %></TD>

		<TD><%=list.get(i).getNome() %></TD>

		<TD><%=list.get(i).getEmail() %></TD>

		<TD><%=list.get(i).getSenha() %></TD>

		<TD><%=list.get(i).getTelefone() %></TD>

		<TD><%=list.get(i).getEndereco() %></TD>

		<TD><%=list.get(i).getNumero() %></TD>

		<TD><%=list.get(i).getComplemento() %></TD>

		<TD><%=list.get(i).getCep() %></TD>

		<TD><%=list.get(i).getCidade() %></TD>

		<TD><%=list.get(i).getEstado() %></TD>

		<TD><%=list.get(i).getPromocao() %></TD>



	</TR>
	<%  } %>

</table>
</form>

<br />
<p><input type="button" name="btnExcluir" value="Excluir"
	onclick="javascript:validar('Excluir')" /></p>

</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end #mainContent --> <!-- begin #footer -->
<div id="footer"><br />
<br />

&nbsp; &nbsp; <strong><pp:formatDate value="${agora}"
	dateStyle="full" /></strong> &nbsp; &nbsp; || &nbsp; &nbsp; <up:label
	property="rodape.texto" /></div>
<!-- end #footer --></div>
<!-- end #container -->
</body>
</html>
